/**
 * 饼图的初始化函数
 * 
 */
window.onload = function() { 
	var params=null;
	var Sumhot=0;
	var canvas = document.getElementById("pie_canvas");  
	var seriesData = [];  
	var color=new Array("blue","yellow","red","black");
	/**异步刷新获取总热度**/
	ajaxpost("/videomessage/getPieChartVo.do", params,function(data){


		for(var i in data){


			Sumhot+=data[i].hot;	


		}

	});


	/*ajax刷新数据*/
	ajaxpost("/videomessage/getPieChartVo.do",params,function(data){
		for (var i in data) {
			var name=data[i].videotype;


			var hot=data[i].hot;


			var arr = '{"name":"'+name+'","value":'+hot/Sumhot+',"color":"'+color[i]+'","label1":"描述1","label2":"描述2"}';
			
			var jsonobj = $.parseJSON(arr); //或用eval方法
		
			seriesData.push(jsonobj);

		}


	});





	var config = {  
			width : 600,   
			height: 600,  
			series: seriesData,  
			canvas: canvas,   
			title:"视频类别对应热度统计图",
			callback:function(obj){
				console.log(obj.label1);
			}
	};  
	console.log("1234567")
	pieChart.initSettings(config);  
	pieChart.render();  

}  